<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<base href="<%=basePath%>">
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>修改员工信息</title>

	<script src=" Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
	<script src=" Scripts/jquery-ui-1.8.custom.min.js" type="text/javascript"></script>
	
	<script type="text/javascript" src="Scripts/ui.validation.js?rand="></script>
	<link rel="stylesheet" href="css/ui.validation.css" type="text/css"></link>
	
	<script type="text/javascript">
	$(function () {
	    switcher();
	    setValidate();
	});
	
	function setValidate(){
	    
   	 $("#form").validatingForm({
       	submitButtonId:"#btnSubmit",
       	clearErrorsOnFocus:true,
       	validateOnBlur:true,
       	summaryTo:"#errorSummary"
       });
   }
	
	function switcher() {
	    $("#sectionSelector").change(function () {
	        var sectionId = $(this).val();
	        $.post("queryPostBySectionInUserAction.action", { "sectionId": sectionId }, function (data) {
	            if (data != '')
	            //对应的物资信息添加到select中
	                $("#postSelector").html("").append(data);
	            else
	                $("#postSelector").html("").append("<option value=\"-1\">-请先选择部门-</option>");
	        }, "html");
	    });
	}
    </script>
     <style type="text/css">
	<!--
	body {
	margin-left: 3px;
	margin-top: 0px;
	margin-right: 3px;
	margin-bottom: 0px;
	}
	.STYLE19 {
		color: #344b50;
		font-size: 12px;
	}
	-->
</style>
</head>
<body>
<form action="updateUser.action" method="post">
		<table id="form" width="60%" border="0" align="center" cellpadding="0" cellspacing="0">
			
			<tr><td colspan="4" height="31" align="center" bgcolor="#FFFFFF" class="STYLE19"><strong>修改员工信息</strong><input type="hidden" name="infoId" value="${usersInfo.userInfo.infoId}" /></td></tr>
			<tr>
			<td height="25" align="center" bgcolor="#FFFFFF" class="STYLE19">员工姓名：</td><td height="25" align="center" bgcolor="#FFFFFF" class="STYLE19"><input type="text" name="userName"  value="${usersInfo.userName}" id="userName" fieldName="员工姓名" class="required-field"/>&nbsp;<input type="hidden" name="userId" value="${usersInfo.userId}" /></td>
			<td height="25" align="center" bgcolor="#FFFFFF" class="STYLE19">密码：</td>
			<td height="25" align="center" bgcolor="#FFFFFF" class="STYLE19"><input type="text" name="password" value="${usersInfo.password}" id="password" fieldName="密码" class="required-field no-Chinese-field"/>&nbsp;</td>
			</tr>
			<tr>
			<td height="25" align="center" bgcolor="#FFFFFF" class="STYLE19">员工性别：</td>
			<td height="25" align="center" bgcolor="#FFFFFF" class="STYLE19">
				<s:radio list='#{ "男":"男", "女":"女"}' name="gender" value="gender" theme="simple"/>
			</td>

			<td height="25" align="center" bgcolor="#FFFFFF" class="STYLE19">年龄：</td><td height="25" align="center" bgcolor="#FFFFFF" class="STYLE19"><input id="age" fieldName="年龄" max="65" min="16" class="required-field number-field betweenvalue-field" type="text" name="age" value="${usersInfo.userInfo.age}"/></td></tr>
			<tr>
			<td height="25" align="center" bgcolor="#FFFFFF" class="STYLE19">联系电话：</td><td height="25" align="center" bgcolor="#FFFFFF" class="STYLE19"><input id="phone" fieldName="联系电话" class="telphone-field required-field" type="text" name="phone" value="${usersInfo.userInfo.phone}"/></td>
			<td height="25" align="center" bgcolor="#FFFFFF" class="STYLE19">家庭住址：</td><td height="25" align="center" bgcolor="#FFFFFF" class="STYLE19"><input id="address" fieldName="家庭住址" class="required-field" type="text" name="address" value="${usersInfo.userInfo.address}"/></td></tr>
			<tr>
			<td height="25" align="center" bgcolor="#FFFFFF" class="STYLE19">电子邮箱：</td><td height="25" align="center" bgcolor="#FFFFFF" class="STYLE19"><input id="mailBox" fieldName="电子邮箱" class="required-field email-field" type="text" name="mailBox" value="${usersInfo.userInfo.mailInfo.mailBox}"/><input type="hidden" name="mailId" value="${usersInfo.userInfo.mailInfo.mailId}" /></td>
			<td height="25" align="center" bgcolor="#FFFFFF" class="STYLE19">所属部门：</td><td height="25" align="center" bgcolor="#FFFFFF" class="STYLE19"><s:select list="sectionList" listKey="sectionId" listValue="sectionName" theme="simple" id="sectionSelector" headerKey="-1" headerValue="-请选择-" name="sectionId" cssClass="selectable-field" emptyValueMsg="请选择部门。" emptyValueForValidate="-1"></s:select></td></tr>
			<tr><td height="25" align="center" bgcolor="#FFFFFF" class="STYLE19">所属职位：</td><td height="25" align="center" bgcolor="#FFFFFF" class="STYLE19"><s:select list="postList" listKey="postId" listValue="postName" name="postId" value="postId" id="postSelector" theme="simple" cssClass="selectable-field" emptyValueMsg="请选择职位。" emptyValueForValidate="-1"></s:select></td><td></td><td></td></tr>
			<tr><td colspan="4" height="25" align="center" bgcolor="#FFFFFF" class="STYLE19"><input id="btnSubmit" type="submit" value="修改" /></td></tr>
			<tr><td colspan="4" align="center"><div id="errorSummary" ></div></td></tr>
		</table>
	</form>
</body>
</html>